<%@ page import="com.hehe.entity.User" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
		 pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
<meta name="description" content="">
<meta name="author" content="">
<!-- 新 Bootstrap 核心 CSS 文件 -->
	<link rel="stylesheet" href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css">
	<script src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
	<script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>

<title>navbar</title>
</head>

<!--inverse是一种导航样式，fixed-top固定导航在顶部  style="background-color: #ffda44;"-->
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container-fluid">
	<div class="navbar-header">
		<button type="button" class="navbar-toggle" data-toggle="collapse"
			data-target="#mynavbar">
			<span class="sr-only">导航切换</span> <span class="icon-bar"></span> <span
				class="icon-bar"></span> <span class="icon-bar"></span>
		</button>
		<a class="navbar-brand" href="/market">跳蚤市场</a>
	</div>
	<div id="mynavbar" class="navbar-collapse collapse">
		<ul class="nav navbar-nav navbar-right">

			<% User user = (User)session.getAttribute("user");
				if(user==null ){ %>
					<li><a href="login">登录</a></li>
			<%}
			else { %>

				<li><a href="logout"><%=user.getNickname()%></a></li>
				<%--<li class="dropdown">--%>
					<%--<a href="logout" class="dropdown-toggle" data-toggle="dropdown" id="dropdownMenu">--%>
						<%--<span><%=user.getUsername()%></span>--%>
						<%--<b class="caret"></b>--%>
					<%--</a>--%>
					<%--<ul class="dropdown-menu" role="menu" aria-labelledby="#dropdownMenu" >--%>
						<%--<li><a href="logout">退出登录</a></li>--%>

					<%--</ul>--%>
				<%--</li>--%>

			<%} %>

			<li><a href="/market">首页</a></li>
			<li><a href="publish">发布信息</a></li>
			<li><a href="personal">个人中心</a></li>
		
		</ul>

		<form class="navbar-form navbar-right" role="search">
			<input type="text" class="form-control" placeholder="搜索...">
			<!-- 并不强调是一个按钮，看起来像一个链接，去掉点击时的下划线，但同时保持按钮的行为 -->
			<button type="submit" class="btn btn-link"
				style="text-decoration: none;">搜索</button>

		</form>


	</div>
</div>
</nav>
<body>


</body>
</html>